//
//  KKImagePickerController.m
//  KKImagePickerController
//
//  Created by Mac mini on 16/1/21.
//  Copyright © 2016年 JuniorCodingPerson. All rights reserved.
//

#import "KKImagePickerController.h"

@implementation KKImagePickerController

+ (void)kk_showErrorMessage:(NSString *)message {
    
    if (message == nil) {
        return;
    }
    
    if (KKDeviceVersion < 8.0) {
        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle: @"提示" message: message delegate: nil cancelButtonTitle: @"关闭" otherButtonTitles: nil];
        [alertView show];
        return;
    }
    else {
        UIAlertController *alertController = [UIAlertController alertControllerWithTitle: @"提示" message: message preferredStyle: UIAlertControllerStyleAlert];
        UIAlertAction *cancelAction = [UIAlertAction actionWithTitle: @"关闭" style:UIAlertActionStyleCancel handler: nil];
        [alertController addAction: cancelAction];
        
        UIViewController *rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController];
        
        [rootViewController presentViewController: alertController animated: true completion: nil];
    }
}

@end
